home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Addition / card_5147.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  9.3 KB  |  422 lines

  1. -- card: 5147 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2518
  5. -- name: 
  6.  
  7.  
  8. -- part 3 (button)
  9. -- low flags: 00
  10. -- high flags: 8003
  11. -- rect: left=354 top=102 right=139 bottom=468
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Next Problem
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if field "Flag" = 0 then exit mouseUp
  23.   show button "Smiley"
  24.   show button "Frowney"
  25.   put empty into field "Comment"
  26.   put "  " into field "Addend1"
  27.   put "  " into field "Addend2"
  28.   put empty into field "Sum"
  29.   if field "Attempts" = second word of bkgnd field "Options" then
  30.     put field "Attempts" into attempts
  31.     put field "Correct" into correct
  32.     put field "Percent" into percent
  33.     put field "Name" into name
  34.     put third word of field "Options" into skill
  35.     put "O" into field "Attempts"
  36.     put "O" into field "Correct"
  37.     put "O" into field "Percent"
  38.     set the lockScreen to true
  39.     set the cursor to 4
  40.     go to first card of bkgnd "Users"
  41.     rotateData
  42.     put name into line 1 of field "name"
  43.     put the date into line 1 of field "Date"
  44.     put skill into line 1 of field "Skill"
  45.     put attempts into line 1 of field "Attempts"
  46.     put correct into line 1 of field "Correct"
  47.     put percent into line 1 of field "Percent"
  48.     pop card
  49.     exit mouseUp
  50.   end if
  51.   get the random of 9
  52.   put it into char 1 of field "Addend1"
  53.   get the random of 10
  54.   subtract 1 from it
  55.   put it into char 1 of field "Addend2"
  56.   put field "Addend1" into answer
  57.   add field "Addend2" to answer
  58.   -- if answer < 10 then put " " into field "Sum"
  59.   put "0" into field "Flag"
  60. end mouseUp
  61.  
  62. on rotateData
  63.   repeat with x = 11 down to 1
  64.     if line x of field "Name" is empty then next repeat
  65.     put x into nextLine
  66.     add 1 to nextLine
  67.     get line x of field "Name"
  68.     put it into line nextLine of field "Name"
  69.     get line x of field "Date"
  70.     put it into line nextLine of field "Date"
  71.     get line x of field "Skill"
  72.     put it into line nextLine of field "Skill"
  73.     get line x of field "Attempts"
  74.     put it into line nextLine of field "Attempts"
  75.     get line x of field "Correct"
  76.     put it into line nextLine of field "Correct"
  77.     get line x of field "Percent"
  78.     put it into line nextLine of field "Percent"
  79.   end repeat
  80. end rotateData
  81.  
  82.  
  83.  
  84.  
  85. -- part 4 (button)
  86. -- low flags: 00
  87. -- high flags: 8003
  88. -- rect: left=355 top=161 right=194 bottom=388
  89. -- title width / last selected line: 0
  90. -- icon id / first selected line: 0 / 0
  91. -- text alignment: 1
  92. -- font id: 0
  93. -- text size: 12
  94. -- style flags: 0
  95. -- line height: 16
  96. -- part name: 7
  97. ----- HyperTalk script -----
  98. on mouseUp
  99.   get the length of field "Sum"
  100.   if it is 2 then exit mouseUp
  101.   add 1 to it
  102.   put "7" into char it of field "Sum"
  103. end mouseUp
  104.  
  105.  
  106.  
  107. -- part 5 (button)
  108. -- low flags: 00
  109. -- high flags: 8003
  110. -- rect: left=395 top=161 right=194 bottom=427
  111. -- title width / last selected line: 0
  112. -- icon id / first selected line: 0 / 0
  113. -- text alignment: 1
  114. -- font id: 0
  115. -- text size: 12
  116. -- style flags: 0
  117. -- line height: 16
  118. -- part name: 8
  119. ----- HyperTalk script -----
  120. on mouseUp
  121.   get the length of field "Sum"
  122.   if it is 2 then exit mouseUp
  123.   add 1 to it
  124.   put "8" into char it of field "Sum"
  125. end mouseUp
  126.  
  127.  
  128.  
  129. -- part 6 (button)
  130. -- low flags: 00
  131. -- high flags: 8003
  132. -- rect: left=435 top=162 right=194 bottom=467
  133. -- title width / last selected line: 0
  134. -- icon id / first selected line: 0 / 0
  135. -- text alignment: 1
  136. -- font id: 0
  137. -- text size: 12
  138. -- style flags: 0
  139. -- line height: 16
  140. -- part name: 9
  141. ----- HyperTalk script -----
  142. on mouseUp
  143.   get the length of field "Sum"
  144.   if it is 2 then exit mouseUp
  145.   add 1 to it
  146.   put "9" into char it of field "Sum"
  147. end mouseUp
  148.  
  149.  
  150.  
  151. -- part 7 (button)
  152. -- low flags: 00
  153. -- high flags: 8003
  154. -- rect: left=356 top=201 right=233 bottom=389
  155. -- title width / last selected line: 0
  156. -- icon id / first selected line: 0 / 0
  157. -- text alignment: 1
  158. -- font id: 0
  159. -- text size: 12
  160. -- style flags: 0
  161. -- line height: 16
  162. -- part name: 4
  163. ----- HyperTalk script -----
  164. on mouseUp
  165.   get the length of field "Sum"
  166.   if it is 2 then exit mouseUp
  167.   add 1 to it
  168.   put "4" into char it of field "Sum"
  169. end mouseUp
  170.  
  171.  
  172.  
  173. -- part 8 (button)
  174. -- low flags: 00
  175. -- high flags: 8003
  176. -- rect: left=395 top=202 right=234 bottom=428
  177. -- title width / last selected line: 0
  178. -- icon id / first selected line: 0 / 0
  179. -- text alignment: 1
  180. -- font id: 0
  181. -- text size: 12
  182. -- style flags: 0
  183. -- line height: 16
  184. -- part name: 5
  185. ----- HyperTalk script -----
  186. on mouseUp
  187.   get the length of field "Sum"
  188.   if it is 2 then exit mouseUp
  189.   add 1 to it
  190.   put "5" into char it of field "Sum"
  191. end mouseUp
  192.  
  193.  
  194.  
  195. -- part 9 (button)
  196. -- low flags: 00
  197. -- high flags: 8003
  198. -- rect: left=435 top=201 right=233 bottom=466
  199. -- title width / last selected line: 0
  200. -- icon id / first selected line: 0 / 0
  201. -- text alignment: 1
  202. -- font id: 0
  203. -- text size: 12
  204. -- style flags: 0
  205. -- line height: 16
  206. -- part name: 6
  207. ----- HyperTalk script -----
  208. on mouseUp
  209.   get the length of field "Sum"
  210.   if it is 2 then exit mouseUp
  211.   add 1 to it
  212.   put "6" into char it of field "Sum"
  213. end mouseUp
  214.  
  215.  
  216.  
  217. -- part 10 (button)
  218. -- low flags: 00
  219. -- high flags: 8003
  220. -- rect: left=356 top=242 right=274 bottom=389
  221. -- title width / last selected line: 0
  222. -- icon id / first selected line: 0 / 0
  223. -- text alignment: 1
  224. -- font id: 0
  225. -- text size: 12
  226. -- style flags: 0
  227. -- line height: 16
  228. -- part name: 1
  229. ----- HyperTalk script -----
  230. on mouseUp
  231.   get the length of field "Sum"
  232.   if it is 2 then exit mouseUp
  233.   add 1 to it
  234.   put "1" into char it of field "Sum"
  235. end mouseUp
  236.  
  237.  
  238.  
  239. -- part 11 (button)
  240. -- low flags: 00
  241. -- high flags: 8003
  242. -- rect: left=395 top=241 right=273 bottom=428
  243. -- title width / last selected line: 0
  244. -- icon id / first selected line: 0 / 0
  245. -- text alignment: 1
  246. -- font id: 0
  247. -- text size: 12
  248. -- style flags: 0
  249. -- line height: 16
  250. -- part name: 2
  251. ----- HyperTalk script -----
  252. on mouseUp
  253.   get the length of field "Sum"
  254.   if it is 2 then exit mouseUp
  255.   add 1 to it
  256.   put "2" into char it of field "Sum"
  257. end mouseUp
  258.  
  259.  
  260.  
  261. -- part 12 (button)
  262. -- low flags: 00
  263. -- high flags: 8003
  264. -- rect: left=436 top=242 right=274 bottom=468
  265. -- title width / last selected line: 0
  266. -- icon id / first selected line: 0 / 0
  267. -- text alignment: 1
  268. -- font id: 0
  269. -- text size: 12
  270. -- style flags: 0
  271. -- line height: 16
  272. -- part name: 3
  273. ----- HyperTalk script -----
  274. on mouseUp
  275.   get the length of field "Sum"
  276.   if it is 2 then exit mouseUp
  277.   add 1 to it
  278.   put "3" into char it of field "Sum"
  279. end mouseUp
  280.  
  281.  
  282.  
  283. -- part 13 (button)
  284. -- low flags: 00
  285. -- high flags: 8003
  286. -- rect: left=355 top=281 right=313 bottom=407
  287. -- title width / last selected line: 0
  288. -- icon id / first selected line: 0 / 0
  289. -- text alignment: 1
  290. -- font id: 0
  291. -- text size: 12
  292. -- style flags: 0
  293. -- line height: 16
  294. -- part name: 0
  295. ----- HyperTalk script -----
  296. on mouseUp
  297.   get the length of field "Sum"
  298.   if it is 2 then exit mouseUp
  299.   add 1 to it
  300.   put "0" into char it of field "Sum"
  301. end mouseUp
  302.  
  303.  
  304.  
  305. -- part 14 (button)
  306. -- low flags: 00
  307. -- high flags: 8003
  308. -- rect: left=414 top=281 right=313 bottom=468
  309. -- title width / last selected line: 0
  310. -- icon id / first selected line: 0 / 0
  311. -- text alignment: 1
  312. -- font id: 0
  313. -- text size: 12
  314. -- style flags: 0
  315. -- line height: 16
  316. -- part name: Enter
  317. ----- HyperTalk script -----
  318. on mouseUp
  319.   global answer
  320.   if field "SUM" < 1 then exit mouseUp
  321.   if field "Flag" > 0 then exit mouseUp
  322.   put field "Addend1" into answer
  323.   add field "Addend2" to answer
  324.   add 1 to field "Attempts"
  325.   if field "Sum" = answer then
  326.     add 1 to field "Correct"
  327.     get field "Correct"
  328.     divide it by field "Attempts"
  329.     multiply it by 100
  330.     put round(it) into field "Percent"
  331.     celebrate
  332.   else
  333.     get field "Correct"
  334.     divide it by field "Attempts"
  335.     multiply it by 100
  336.     put round(it) into field "Percent"
  337.     nag
  338.   end if
  339. end mouseUp
  340.  
  341. on celebrate
  342.   put "Correct" into line 1 of field "Comment"
  343.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  344.   hide button "Smiley"
  345.   put "1" into field "Flag"
  346.   if first word of bkgnd field "Options" = "Y" then
  347.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  348.   end if
  349. end celebrate
  350.  
  351. on nag
  352.   global answer
  353.   put "WRONG!" into line 1 of field "Comment"
  354.   put "The answer is "& answer & "." into line 3 of field "Comment"
  355.   hide button "Frowney"
  356.   put "2" into field "Flag"
  357.   if first word of bkgnd field "Options" = "Y" then
  358.     play "boing" tempo 200 "gq c e a"
  359.   end if
  360. end nag
  361.  
  362.  
  363.  
  364. -- part 15 (button)
  365. -- low flags: 00
  366. -- high flags: 0001
  367. -- rect: left=33 top=190 right=281 bottom=132
  368. -- title width / last selected line: 0
  369. -- icon id / first selected line: 0 / 0
  370. -- text alignment: 1
  371. -- font id: 0
  372. -- text size: 12
  373. -- style flags: 0
  374. -- line height: 16
  375. -- part name: Smiley
  376.  
  377.  
  378. -- part 16 (button)
  379. -- low flags: 00
  380. -- high flags: 0001
  381. -- rect: left=226 top=195 right=288 bottom=329
  382. -- title width / last selected line: 0
  383. -- icon id / first selected line: 0 / 0
  384. -- text alignment: 1
  385. -- font id: 0
  386. -- text size: 12
  387. -- style flags: 0
  388. -- line height: 16
  389. -- part name: Frowney
  390.  
  391.  
  392. -- part contents for background part 1
  393. ----- text -----
  394.   
  395.  
  396. -- part contents for background part 2
  397. ----- text -----
  398.   
  399.  
  400. -- part contents for background part 4
  401. ----- text -----
  402. 1
  403.  
  404. -- part contents for background part 6
  405. ----- text -----
  406. O
  407.  
  408. -- part contents for background part 7
  409. ----- text -----
  410. O
  411.  
  412. -- part contents for background part 8
  413. ----- text -----
  414. O
  415.  
  416. -- part contents for background part 10
  417. ----- text -----
  418. Y 5 2
  419.  
  420. -- part contents for background part 11
  421. ----- text -----
  422. larry